From: Keir Fraser Date: Thu, 2 Apr 2009 10:48:10 +0000 (+0100) Subject: network-bridge: Fix do_ifup in the case of ${bridge} != ${netdev} X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13989^2~13 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=0c29f97df0f61098c96a411ad745bb24e0adc7ae;p=xen.git network-bridge: Fix do_ifup in the case of ${bridge} != ${netdev} On RHEL5.2, ifup ${bridge} fails if ${bridge} != ${netdev}, because RHEL5.2's ifup ${bridge} runs the following sequence: 1. Search CONFIG that has the same mac address of ${bridge}.=20 ifcfg-${netdev} is found. 2. Run "ip link set dev ${netdev} up". # ${bridge} is expected. 3. Output "Failed to bring up ${netdev}." Because ${netdev} does not exist. Thus, do_ifup() should not use ifup if ${bridge} != ${netdev}. Signed-off-by: KUWAMURA Shin'ya --- diff --git a/tools/hotplug/Linux/network-bridge b/tools/hotplug/Linux/network-bridge index 9d7be4e2e5..091b8beb3e 100644 --- a/tools/hotplug/Linux/network-bridge +++ b/tools/hotplug/Linux/network-bridge @@ -106,7 +106,7 @@ get_ip_info() { } do_ifup() { - if ! ifup $1 ; then + if [ $1 != "${netdev}" ] || ! ifup $1 ; then if [ -n "$addr_pfx" ] ; then # use the info from get_ip_info() ip addr flush $1 @@ -223,9 +223,9 @@ op_start () { preiftransfer ${netdev} transfer_addrs ${netdev} ${tdev} + # Remember the IP details for do_ifup. + get_ip_info ${netdev} if ! ifdown ${netdev}; then - # If ifdown fails, remember the IP details. - get_ip_info ${netdev} ip link set ${netdev} down ip addr flush ${netdev} fi